package main

import (
	"fmt"
	"gogogo-testing-ground/utils"
	"log"
	"time"
)

func main() {
	url := "http://192.168.0.57:8081/"
	cliConf := new(utils.HttpDirectoryConfig)
	cliConf.CreateHttpDirectory(url, "D:\\uploads\\http")
	time1 := time.Now()
	//下载文件夹
	err := cliConf.GetUrlPaths(url, "")
	time2 := time.Now() // 假设是我们的某个时间点
	subTime := time2.Sub(time1).Seconds()
	if err != nil {
		log.Fatalln("发生错误:", err)
	} else {
		fmt.Printf("下载成功，一共%d个文件, 历时%f秒\n", cliConf.FileCount, subTime)
	}
}
